﻿USE [RestaurantManagement]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Nguyễn Đức Thắng>
-- Create date: <15/03/2013>
-- Get_PageSize_Districts
-- =============================================
CREATE PROCEDURE [dbo].[Get_PageSize_Stock]
AS
BEGIN
	DECLARE @NumberOfPage INT
	DECLARE @RowsNumber INT
	
	SELECT @NumberOfPage = d.OptionValue FROM Admin.DBOption d
	WHERE d.OptionID = 'NumberOfPage'

	SELECT @RowsNumber = COUNT(*) FROM Production.[Stock] p
	
	SELECT @RowsNumber / @NumberOfPage TotalPage
END 
